#!/sbin/openrc-run
supervisor=supervise-daemon

name="mautrix-signal"
description="Daemon for Mautrix-Signal, a Matrix-Signal puppeting bridge"

: ${config:="/etc/mautrix-signal/config.yaml"}
: ${command_user:="mautrix-signal:mautrix-signal"}

command="/usr/bin/mautrix-signal"
command_args="-c $config $command_args"

depend() {
	need net
}

start_pre() {
	checkpath --file --owner "$command_user" "$config"
	checkpath --directory --owner "$command_user" /var/log/mautrix-signal
}
